package com.Moch.Abstract;

public class TestShape {

    public static void main(String[] args) {
        Shape[] arr = {new Circle(2), new Rect(2.3, 4.1), new Triangle(1, 2, 3), new Circle(3)};
        for(Shape x : arr) {
            x.draw();
            x.calcArea();
        }
        System.out.println("--------------------------");
        PrintShape(arr);

    }

    public static void PrintShape(Shape[] shape) {
        for(Shape x : shape) {
            if(x instanceof Circle) {
                Circle circle1 = (Circle) x;
                circle1.Ccc();
            } else if(x instanceof Rect) {
                Rect rect1 = (Rect) x;
                rect1.Rrr();
            } else if(x instanceof Triangle) {
                Triangle triangle1 = (Triangle) x;
                triangle1.Ttt();
            } else {
                return ;
            }
        }
    }

}
